package com.blog.utils;

import java.text.SimpleDateFormat;
import java.util.*;

/**
 * 时间工具类
 *
 * @author wmb
 *
 * @since 2021-2-8
 */
public class DateKit {

    public static String formatDateByUnixTime(Date unixTime, String dateFormat) {
        return dateFormat(unixTime, dateFormat);
    }

    public static String dateFormat(Date date, String dateFormat) {
        if(date != null) {
            SimpleDateFormat format = new SimpleDateFormat(dateFormat);
            return format.format(date);
        }

        return "";
    }

}
